package vocabularyhub.word.mw.thesaurus.impl;

import java.io.Serializable;

import vocabularyhub.word.model.IWord;
import vocabularyhub.word.mw.thesaurus.model.IThesaurusItem;
import vocabularyhub.word.mw.thesaurus.model.IThesaurusWord;

public class ThesaurusWord implements IThesaurusWord, Serializable {

    private static final long serialVersionUID = 4109513072872424177L;

    String word;

    private IThesaurusItem[] thesaurus;

    public String getWord() {
        return word;
    }

    public void setWord(String word) {
        this.word = word;
    }

    @Override
    public String toString() {
        return String.format("\"%s\": %d thesaurus.", word, thesaurus.length);
    }

    @Override
    public boolean getContainsTheasurus() {

        if ((thesaurus == null) || (thesaurus.length == 0)) {
            return false;
        }
        return true;
    }

    @Override
    public IThesaurusItem[] getThesaurusItems() {
        return this.thesaurus;
    }

    @Override
    public void setThesaurusItems(IThesaurusItem[] thesaurusItems) {
        this.thesaurus = thesaurusItems;

    }

    @Override
    public int compareTo(IWord arg0) {
        return word.compareTo(arg0.getWord());
    }

}
